package com.dmgameclient.common;

/**
 * @name Constant
 * @Descripation <br>
 *               1、<br>
 *               2、<br>
 * @author 樊俊彬
 * @date 2014-9-20
 * @version 1.0
 */
public class URLHelper {

	public static final String ENCODE = "utf-8";
	public static final String BASE_URL = "http://www.3dmgame.com";

	public static String ARTICLE_LIST_URL = "http://www.3dmgame.com/sitemap/api.php?row=10&typeid=###&paging=1&page=@@@";
	public static String ARTICLE_DETAIL_URL = "http://www.3dmgame.com/sitemap/api.php?id=###&typeid=@@@";
	public static String COMMENT_LIST_URL = "http://www.3dmgame.com/sitemap/api.php?type=1&aid=###&pageno=@@@";
	public static String PUB_COMMENT_URL = "http://www.3dmgame.com/sitemap/api.php?type=2";
	public static String FORUM_URL = "http://bbs.3dmgame.com/forum.php";
	public static String GAME_LIST_URL = "http://www.3dmgame.com/sitemap/api.php?row=12&typeid=###&paging=1&page=@@@";

	public static final String TYPE_ARTICLE_1 = "2";
	public static final String TYPE_ARTICLE_2 = "25";
	public static final String TYPE_ARTICLE_3 = "154";
	public static final String TYPE_ARTICLE_4 = "153";
	public static final String TYPE_ARTICLE_5 = "151";

	public static final String TYPE_GAME_1 = "181";
	public static final String TYPE_GAME_2 = "182";
	public static final String TYPE_GAME_3 = "183";
	public static final String TYPE_GAME_4 = "184";
	public static final String TYPE_GAME_5 = "185";
	public static final String TYPE_GAME_6 = "186";
	public static final String TYPE_GAME_7 = "187";
	public static final String TYPE_GAME_8 = "188";
	public static final String TYPE_GAME_9 = "189";
	public static final String TYPE_GAME_10 = "190";
	public static final String TYPE_GAME_11 = "191";
	public static final String TYPE_GAME_12 = "192";

	public static final String CACHE_IMAGE_ARTICLE = "/DMgame/article/";
	public static final String CACHE_IMAGE_GAME = "/DMgame/game/";

	/**
	 * 文章列表的URL
	 * 
	 * @param type
	 * @param page
	 * @return String
	 */
	public static String getArticleListUrl(String type, int page) {
		String url = ARTICLE_LIST_URL;
		url = url.replace("###", type);
		url = url.replace("@@@", String.valueOf(page));
		return url;
	}

	/**
	 * 评论列表的URL
	 * 
	 * @param type
	 * @param page
	 * @return String
	 */
	public static String getCommentListUrl(String aid, int page) {
		String url = COMMENT_LIST_URL;
		url = url.replace("###", aid);
		url = url.replace("@@@", String.valueOf(page));
		return url;
	}

	public static String getPubCommentsUrl() {
		String url = PUB_COMMENT_URL;
		return url;
	}

	/**
	 * 游戏列表的URL
	 * 
	 * @param type
	 * @param page
	 * @return String
	 */
	public static String getGameListUrl(String type, int page) {
		String url = GAME_LIST_URL;
		url = url.replace("###", type);
		url = url.replace("@@@", String.valueOf(page));
		return url;
	}
}
